<template>
  <div class="org">
    <el-form ref="form" :model="form" label-width="80px" class="form">
	<div style="font-weight: bold;">赛事名称：{{com_info.name}}</div>
	<div class="line"></div>
    </el-form>
    <div class="orgTable">
		<div style="display: inline-block;margin-right: 138px;">
			<p>主办单位：{{com_info.host.replace(/,/g,' ')}}</p>
			<p>比赛地点：{{com_info.address}}</p>
			<p>报名截止时间：{{com_info.end_time}}</p>
		</div>
		<div style="display: inline-block;">
			<p>承办单位：{{com_info.assist.replace(/,/g,' ')}}</p>
			<p>裁判长：{{com_info.ref_id}}</p>
			<p> 比赛开始时间：{{com_info.start_time}}</p>
		</div>
		<div class="line"></div>
    </div>
	<div class="tableData">
      <el-table :data="tableData" stripe style="width: 80%">
        <el-table-column prop="match_date" label="时间" width="100">
        </el-table-column>
        <el-table-column prop="group_name" label="项目组别" width="180">
        </el-table-column>
        <el-table-column prop="" label="轮次" width="80">
					<template slot-scope="scope">
						<span>第{{scope.row.wheel}}轮</span>
					</template>
        </el-table-column>
        <el-table-column prop="player" label="运动员" width="180">
        </el-table-column>
        <el-table-column prop="match_time" label="比赛用时" width="100">
        </el-table-column>
        <el-table-column prop="score" label="比分" width="100">
        </el-table-column>
        <el-table-column prop="win_site" label="胜者">
        </el-table-column>
      </el-table>
      <el-pagination background layout="prev, pager, next" :total="total" @current-change="ChangePage" style=" float: right;margin-top: 10px; margin-bottom: 40px; margin-right: 150px;">
      </el-pagination>
  </div>
	    <div style="text-align: center;margin-top: 64px">
	  <el-button type="info" @click="goBack">返回</el-button>
	</div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {
        keyword: '',
        state: '',
      },
      tableData: [],
      total: '',
      currentPage: 1,
			com_info:{}
    }
  },
  created() {
    this.get_allclub()
  },
  methods: {
    onSubmit() {
      this.get_allclub()
    },
    get_allclub() {
      this.$axios.post('/UserManage/judge_com_detail', {
          ref_id: this.$route.query.matchId,
          com_id: this.$route.query.id,
          page: this.currentPage
        }, {
          headers: {
            token: window.sessionStorage.getItem('token')
          }
        })
        .then(res => {
          if (res.data.code == 2000) {
						this.com_info = res.data.data.com_info
            this.tableData = res.data.data.platoon
            this.total = res.data.data.count
          }
        })
        .catch(error => {
          console.log(error)
        });
    },
    ChangePage(page) {
      this.currentPage = page
      this.get_allclub()
    },
    goBack() {
      this.$router.go(-1)
    }
  }
}

</script>
<style lang="less" scoped>
.org {
  margin-top: 36px;
  .form {
    margin-left: 38px;
    margin-bottom: 12px;
    .keyword {
      width: 410px;
    }
    .state {
      width: 200px;
    }
    .search {
      width: 123px;
      text-align: right;
    }
  }
  .line {
    width: 80%;
    /*height: 0.5px;*/
    border-top: 1px #dcdfe6 dotted;
	margin-top: 15px;
	margin-bottom: 27px;
  }
  .orgTable {
    margin-top: 34px;
    margin-left: 38px;
	p{
		margin-bottom: 18px;
	}
  }
}
.tableData{
	margin-left: 38px;
}


</style>
